<!DOCTYPE html>
<html>
<head>
    <title>JavaScript拖动</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .content{
            position: absolute;
            top: 0;
            bottom: 0;
            width: 100%;
            overflow: hidden;
            background: orange;
        }
        #drag{
            position: fixed;
            top: 100px;
            left: 200px;
            width: 100px;
            height: 100px;
            background: red;
　　　　　}
    </style>
</head>
<body>
    <div class="content">
        <div id="drag"></div>
    </div>
   
</body>
</html>
<!-- 引入拖动脚本 -->
 <script src="drag.js"></script>
<script type="text/javascript">
    drag.init('drag',function(){
        console.log('点击');
    })
</script>